import api from "../utils/request";
const baseUrl = "/api/api/sys/user";
export function list(sysRoleQuery) {
  return api.post(`${baseUrl}/list`, sysRoleQuery);
}

export function add(sysUser) {
  return api.post(`${baseUrl}/add`, sysUser);
}

export function upd(sysUser) {
  return api.put(`${baseUrl}/upd`, sysUser);
}

export function updPassword(passwordData) {
  return api.put(`${baseUrl}/updPassword`, passwordData);
}

export function del(id) {
  return api.delete(`${baseUrl}/del`, {
    params: {
      id: id,
    },
  });
}

export function updDisable(id, disable) {
  return api.get(`${baseUrl}/updDisable`, {
    params: {
      id: id,
      disable: disable,
    },
  });
}

export function findById(id) {
  return api.get(`${baseUrl}/findById`, {
    params: {
      id: id,
    },
  });
}

export function findUserTree() {
  return api.get(`${baseUrl}/findUserTree`);
}

export function getIpInfo() {
  return api.get(`${baseUrl}/getIpInfo`);
}

export function getUserInfo() {
  return api.get(`${baseUrl}/getUserInfo`);
}
